package com.k.kpp.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/view")
public class ViewController {
    private final static String DELIMITER = "/";
    @RequestMapping("/{path1}")
    public String firstPath (@PathVariable("path1") String path1) {
        return path1;
    }

    @RequestMapping("/{path1}/{path2}")
    public String money (@PathVariable("path1") String path1, @PathVariable("path2") String path2) {
        return path1 + DELIMITER + path2;
    }

    @RequestMapping("/{path1}/{path2}/{path3}")
    public String thirdPath (@PathVariable("path1") String path1, @PathVariable("path2") String path2,@PathVariable("path3") String path3) {
        return path1 + DELIMITER + path2 + DELIMITER + path3;
    }
}
